<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="com.neusoft.news.bean.News,com.neusoft.news.bean.Column"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>投稿</title>
<style type="text/css">
h1{
	text-align: center;
}
.div_addNews{
/*	background-color: lightgrey;*/
	width: 50%;
	margin: auto;
	/*padding: 30px;*/
	display: flex;
	flex-direction: column;
}
.div_xinxi{
	width: 100%;
	height: 30px;
	margin: 10px;
	display: flex;
	align-items: stretch;
}
.input_xinxi{
	height: 100%;
	flex-grow:1;
}
.label_xinxi{
	font-size: 25px;
	width: 130px;
}
</style>
</head>
<body>
	<h1>投稿</h1>
	<div class="div_addNews">
		<form class="form_news" role="form" action="AddNewsServlet" method="post" enctype="multipart/form-data">
			<div class="div_xinxi">
				<label for="news_id" class="label_xinxi">新闻id：</label>
				<input type="text" name="news_id" id="news_id" placeholder="新闻id" class="input_xinxi" >
			</div>
			<div class="div_xinxi">
				<label for="news_title" class="label_xinxi">新闻标题：</label>
				<input type="text" name="news_title" id="news_title" placeholder="新闻标题" class="input_xinxi" >
			</div>
			<div class="div_xinxi">
				<label for="news_intro" class="label_xinxi">新闻摘要：</label>
				<input type="text" name="news_intro" id="news_intro" placeholder="新闻摘要" class="input_xinxi" >
			</div>
			<div class="div_xinxi" style="height: 200px;">
				<label for="news_content" class="label_xinxi">新闻正文：</label>
				<!-- <input type="text" name="news_content" id="news_content" placeholder="新闻正文" class="input_xinxi" > -->
				<textarea name="news_content" id="news_content" placeholder="新闻正文" class="input_xinxi" style="height: 200px;"></textarea>
			</div>
			<div class="div_xinxi">
				<label for="columns_id" class="label_xinxi">栏目id：</label>
				<!-- <input type="text" name="columns_id" id="columns_id" placeholder="栏目id" class="input_xinxi" > -->
			<%	java.util.List<Column> columnlist = (java.util.List)request.getAttribute("columnlist"); 
				if(columnlist!=null){ 
			%>
			<select name="columns_id" id="columns_id" class="input_xinxi">
				<% for(Column col:columnlist){ %>
				<option value="<%=col.getColumn_id() %>"><%=col.getColumn_name() %></option>
				<% } %>
			</select>
			<%	} %>
			
			</div>
			<div class="div_xinxi">
				<label for="news_photo" class="label_xinxi">照片：</label>
				<input type="file" name="news_photo" id="news_photo" placeholder="照片" class="input_xinxi" >
			</div>
			<div class="div_xinxi">
				<label for="news_place" class="label_xinxi">地点：</label>
				<input type="text" name="news_place" id="news_place" placeholder="地点" class="input_xinxi" >
			</div>
			<div class="div_xinxi">
				<label for="news_author" class="label_xinxi">作者：</label>
				<input type="text" name="news_author" id="news_author" placeholder="作者" class="input_xinxi" value="${user.userName }">
			</div>
			<div class="div_xinxi">
				<label for="news_important" class="label_xinxi">优先级：</label>
				<select id="news_important" name="news_important" class="input_xinxi">
					<option value="0">普通</option>
					<option value="1">测试用（无需审核）</option>
				</select>
			</div>
			<div class="div_xinxi">
				<input type="submit" class="input_xinxi" style="background-color: lightgreen;">
				<input type="reset" class="input_xinxi"  >
			</div>
		</form>
	</div>
</body>
</html>